package com.winxuan.channel.model.commodity;

import java.io.Serializable;

import javax.persistence.Column;

public class CommoditySnapPK implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3750545849760780999L;

	@Column(name = "distribute")
	private Integer distribute;
	@Column(name = "commodity")
	private Integer commodity;
	
	
	public Integer getDistribute() {
		return distribute;
	}
	public void setDistribute(Integer distribute) {
		this.distribute = distribute;
	}
	public Integer getCommodity() {
		return commodity;
	}
	public void setCommodity(Integer commodity) {
		this.commodity = commodity;
	}

	public int hashCode(){
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((distribute == null) ? 0 : distribute.hashCode());
		result = PRIME * result + ((commodity == null) ? 0 : commodity.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final CommoditySnapPK other = (CommoditySnapPK) obj;
		if (distribute == null) {
			if (other.distribute != null)
				return false;
		} else if (!distribute.equals(other.distribute))
			return false;
		if (commodity == null) {
			if (other.commodity != null)
				return false;
		} else if (!commodity.equals(other.commodity))
			return false;
		return true;
	}
	
	public String toString(){
		return "commodity:commodity="+commodity;
	}

}
